package pers.brozen.anka.support.verify;

import lombok.Getter;
import pers.brozen.anka.support.web.response.ErrorCodes;

/**
 * @author brozen
 * @since 2020/12/23
 */
public class VerifyException extends RuntimeException {

    private static final Object[] NO_ARG = new Object[0];

    private static final long serialVersionUID = -2537847158042043944L;

    @Getter
    private final ErrorCodes status;

    @Getter
    private Object data;

    @Getter
    private final Object[] msgArgs;

    public VerifyException(ErrorCodes status) {
        this(status, NO_ARG);
    }

    public VerifyException(ErrorCodes status, Object[] msgArgs) {
        super();
        this.status = status;
        this.msgArgs = msgArgs;
    }

    public VerifyException(ErrorCodes status, String msg) {
        this(status, msg, NO_ARG);
    }

    public VerifyException(ErrorCodes status, String msg, Object[] msgArgs) {
        super(msg);
        this.status = status;
        this.msgArgs = msgArgs;
    }

    public VerifyException(ErrorCodes status, Object data) {
        this(status, NO_ARG, data);
    }

    public VerifyException(ErrorCodes status, Object[] msgArgs, Object data) {
        super();
        this.status = status;
        this.msgArgs = msgArgs;
        this.data = data;
    }

    public VerifyException(ErrorCodes status, String msg, Object data) {
        this(status, msg, NO_ARG, data);
    }

    public VerifyException(ErrorCodes status, String msg, Object[] msgArgs, Object data) {
        super(msg);
        this.status = status;
        this.msgArgs = msgArgs;
        this.data = data;
    }

}
